package cn.yunhe.control;

import cn.yunhe.entity.Book;
import cn.yunhe.server.BookServer;
import com.alibaba.fastjson.JSON;

import java.util.List;

public class BookAction extends ActionBase {
    private int choose; //查询选项,当该值为0时查询全部
    private String condition;
    private List<Book> list;

    public String query(){
        BookServer bookServer = new BookServer();
        if (condition.equals("")){ //如果查询条件为空则把选择序号改为0,查询全部
            choose = 0;
        }
        list = bookServer.queryBook(condition, choose);
        return SUCCESS;
    }

    public int getChoose() {
        return choose;
    }

    public void setChoose(int choose) {
        this.choose = choose;
    }

    public String getCondition() {
        return condition;
    }

    public void setCondition(String condition) {
        this.condition = condition;
    }

    public List<Book> getList() {
        return list;
    }

    public void setList(List<Book> list) {
        this.list = list;
    }
}
